package cn.cloud.all.security.oauth2.common.exceptions;

import cn.cloud.all.security.oauth2.common.util.OAuth2Utils;

import java.util.Set;

@SuppressWarnings("serial")
public class InvalidScopeException extends OAuth2Exception {

    public InvalidScopeException(String msg, Set<String> validScope) {
        this(msg);
        addAdditionalInformation("scope", OAuth2Utils.formatParameterList(validScope));
    }

    public InvalidScopeException(String msg) {
        super(msg);
    }

    @Override
    public String getOAuth2ErrorCode() {
        return "invalid_scope";
    }

}